#include "modeldeleagedialog.h"
#include "ui_modeldeleagedialog.h"

ModelDeleageDialog::ModelDeleageDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ModelDeleageDialog)
{
    ui->setupUi(this);
    model = new QStandardItemModel(4, 2, this);
    delegate = new MyDelegate(this);
    ui->tableView->setModel(model);

    for (int row = 0; row < 4; ++row){
        for (int column = 0; column < 2; ++column){
            QModelIndex index = model->index(row, column, QModelIndex());
            model->setData(index, 0);
        }
    }
    ui->tableView->setItemDelegate(delegate);
}

ModelDeleageDialog::~ModelDeleageDialog()
{
    delete ui;
}
